﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Template.aspx.cs" Inherits="UpdateApp.Template" ValidateRequest="false" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="JavaScript-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
    <title>在线文档</title>
    <link href="CSS/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/JavaScript/umeditor1_2_2-utf8-net/themes/default/css/umeditor.css" type="text/css" rel="stylesheet" />
    <style>
        .font {
            margin: 10px 50px;
            width: 8rem;
            font-size: 2rem;
        }
    </style>
</head>

<script src="JavaScript/JQuery-1.9.1.min.js"></script>
<script src="CSS/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>

<script type="text/javascript" charset="utf-8" src="/JavaScript/umeditor1_2_2-utf8-net/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/JavaScript/umeditor1_2_2-utf8-net/umeditor.min.js"></script>
<script type="text/javascript" src="/JavaScript/umeditor1_2_2-utf8-net/lang/zh-cn/zh-cn.js"></script>

<body>
    <form id="aspnetForm" runat="server" enctype="multipart/form-data">

        <div class="container">
            <div class="row">
                <div class="form-inline">
                    <button type="button" class="btn btn-default font" onclick='window.location.href = "<%=File %>"'>返回</button>
                    <button type="submit" class="btn btn-success font">完成</button>
                </div>
            </div>
            <div class="row">
                <div class="form-inline  col-md-offset-1" style="margin-top: 1rem">
                    <label for="reqParams" style="margin-left: 2rem">文件名：</label>
                    <input runat="server" type="text" value="" class="form-control" id="title" style="margin-left: 1rem; width: 55%" />
                    <input runat="server" type="radio" name="type" id="html" value="html" style="margin-left: 2rem;" /><label for="html">&nbsp;.html</label>
                    <input runat="server" type="radio" name="type" id="txt" value="txt" style="margin-left: 1rem" /><label for="txt">&nbsp;.txt</label>
                    <input runat="server" type="radio" name="type" id="ini" value="ini" style="margin-left: 1rem" /><label for="ini">&nbsp;.ini</label>
                    <input runat="server" type="checkbox" name="chk" id="chk" value="1" style="margin-left: 1rem" /><label for="chk">&nbsp;临时空间</label>
                </div>
            </div>
            <div class="row" id="editor" style="display: <%=html.Checked ? "":"none" %>">
                <div class="col-md-15" style="margin-top: 1rem">
                    <script type="text/plain" id="myEditor" style="width: 96%;"><%=Content %></script>
                </div>
            </div>
            <div class="row" id="textarea" style="display: <%=!html.Checked ? "":"none" %>">
                <div class="col-md-15" style="margin: 1rem 4.5rem">
                    <textarea runat="server" id="myTextarea" style="width: 100%; height: 48rem"></textarea>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
<script>

    window.UMEDITOR_CONFIG = {
        toolbar: ['source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |', 'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize',
            '| justifyleft justifycenter justifyright justifyjustify |', '| horizontal print preview fullscreen']
    }

    //实例化编辑器
    var um = UM.getEditor('myEditor', window.UMEDITOR_CONFIG);

    $(function () {
        $("#html").click(function () {
            $("#editor").show();
            $("#textarea").hide();
        });

        $("#txt,#ini").click(function () {
            $("#editor").hide();
            $("#textarea").show();
        });
    });

</script>
